From 5d9baf79409d72321934f5dd5edba85c75c6b8dc Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Mon, 19 Sep 2005 13:23:22 +0000 Subject: [PATCH] Don't do device create on domain recreate. Also don't add XendDomainInfo object to XendDomain dictionary from XendDomainInfo object but do it in XendDomain. Signed-off-by: Christian Limpach --- tools/python/xen/xend/XendDomain.py | 1 + tools/python/xen/xend/XendDomainInfo.py | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index e835ea9063..93427e9851 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -276,6 +276,7 @@ class XendDomain: @return: domain """ dominfo = XendDomainInfo.create(self.dbmap, config) + self._add_domain(dominfo) return dominfo def domain_restart(self, dominfo): diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index f26323cb94..db33cecae7 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -538,7 +538,6 @@ class XendDomainInfo: self.init_image() self.configure_cpus(config) self.init_domain() - self.register_domain() # Create domain devices. self.configure_backends() @@ -554,11 +553,6 @@ class XendDomainInfo: self.destroy() raise - def register_domain(self): - xd = get_component('xen.xend.XendDomain') - xd._add_domain(self) - self.exportToDB(save=True) - def configure_cpus(self, config): try: self.cpu_weight = float(sxp.child_value(config, 'cpu_weight', '1')) @@ -746,6 +740,8 @@ class XendDomainInfo: @raise: VmError for invalid devices """ + if self.recreate: + return if not self.rebooting(): self.create_configured_devices() self.image.createDeviceModel() -- 2.30.2